package com.gk.kafkaproduce.service.impl;

import com.gk.kafkaproduce.service.ProduceTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Service;

@Service
@EnableBinding(Source.class)
public class ProduceTestServiceImpl implements ProduceTestService {

    @Autowired
    private Source source;

    @Override
    public void sendMsg(String msg) {
        source.output().send(MessageBuilder.withPayload(msg).build());
    }
}
